package club.kingyin.kyblog.core.extend;

import club.kingyin.kyblog.core.utils.log.*;
import org.springframework.core.annotation.AliasFor;

import java.lang.annotation.*;

/**
 * @author ：kingyin
 * @date ：创建于 2021/9/11 1:46 上午
 * @description ：
 * @modified By：
 * @version: 1.0.0
 */
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Log(postProcessor = {PostProcessorSecurity.class, PostProcessorConsole.class}, execute = ExecutePostProcessorLimit.class)
public @interface LogLimitConsole {
    @AliasFor(
            annotation = Log.class,
            attribute = "module"
    )
    String module() default "";

    @AliasFor(
            annotation = Log.class,
            attribute = "operator"
    )
    String operator() default "";

    @AliasFor(
            annotation = Log.class,
            attribute = "sources"
    )
    Class<? extends BeforePostProcessor> sources() default IPSetPostProcessor.class;

    // 请求参数相同则生效，否则放行
    String[] params() default {};

    Class<?> paramsType();

    // 最大请求次数
    int max() default 5;

    // 限制周期 单位秒
    int expire() default 24 * 60 * 60;
}
